# Maintainer: Thore Bödecker <foxxx0@archlinux.org>
# Contributor: Chris Down <chris@chrisdown.name>

pkgname=clipmenu
pkgver=6.2.0
pkgrel=2
pkgdesc='Clipboard management using dmenu'
url='https://github.com/cdown/clipmenu'
arch=('any')
license=('custom:Public Domain')
depends=('dmenu' 'xsel' 'clipnotify' 'xdotool')
optdepends=(
  'rofi: dmenu replacement (use with "export CM_LAUNCHER=rofi")'
  'fzf: terminal fuzzy launcher (use with "export CM_LAUNCHER=fzf")'
)

source=("${pkgname}-${pkgver}.tar.gz::https://github.com/cdown/clipmenu/archive/${pkgver}.tar.gz")
sha512sums=('adfd649a120264552e2c05314ae2ad039055308f77d620dbb3fc206e4244a6f1f2e5ed4a7e86fd547a78692aebaec1761528e10408d838f80def99959ef58295')

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  for _executable in clip{menu,menud,del,fsck,ctl};
  do
    install -D -m755 "${_executable}" "${pkgdir}/usr/bin/${_executable}"
  done
  install -D -m644 init/clipmenud.service "${pkgdir}/usr/lib/systemd/user/clipmenud.service"
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
